package com.fa4j.common.base.model;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * 删除命令
 */
@Data
public class RemoveCmd<T> extends AbstractCmd {

    /**
     * 主键ID
     */
    @NotNull(message = "{validation.cmd.id.NotNull}")
    @Schema(description = "主键ID")
    private T id;

    public static <T> RemoveCmd<T> of(T id) {
        RemoveCmd<T> cmd = new RemoveCmd<>();
        cmd.setId(id);
        return cmd;
    }

    public static <T> RemoveCmd<T> of(T id, Long operatorId) {
        RemoveCmd<T> cmd = new RemoveCmd<>();
        cmd.setId(id);
        cmd.setOperatorId(operatorId);
        return cmd;
    }

}
